<?php
class Bbling_Model_Entity_Intruduction extends Evebit_Model_Abstract {
	
	protected $_resourceName = "Bbling_Model_Resource_Intruduction";
	
	protected $_resourceCollectionName = "Bbling_Model_Collection_Intruduction";
	
    protected function _afterLoad() {
		return $this;
	}
	
	/**
	 * (non-PHPdoc)
	 * @see Evebit_Model_Abstract::_beforeSave()
	 */
	protected function _beforeSave() {	
		return $this;
	}
	/**
	 * (non-PHPdoc)
	 * @return Evebit_Model_Abstract::_beforeDelete()
	 */
	protected function _beforeDelete() {
		return $this;
	}

    public function getFormField($tableName) {
		$fileds = parent::getFormField ( $tableName );
		foreach ( $fileds as $key => $filed ) {
			switch ($key) {
				case 'content' :
					$fileds [$key] ['type'] = 'richedit';
					break;
			}
		}
		return $fileds;
	}
	
	public function getPlanIntruduction($name){
		$items = $this->getCollection()->getItems();
		foreach ($items as $item){
			if ($item->name == $name){
				return $item->content;
			}
		}
		
		return FALSE;
	}
	
}